package gold.digger;

import gold.utils.InputUtil;

/**
 * Created by fanzhenyu02 on 2021/12/10.
 * common problem solver template.
 */
public class LC961 {
    public long startExecuteTime = System.currentTimeMillis();


    class Solution {
        public int repeatedNTimes(int[] nums) {
            if (nums[0] == nums[2]) return nums[0];
            for (int i = 0; i < nums.length - 1; i++) {
                if (nums[i] == nums[i + 1]) return nums[i];
            }
            return nums[nums.length - 1];
        }
    }

    public void run() {
        int[] arr = InputUtil.toIntegerArray("[1,2,3]");
        System.out.println(new Solution().toString());
    }

    public static void main(String[] args) throws Exception {
        LC961 an = new LC961();
        an.run();

        System.out.println("\ncurrent solution total execute time: " + (System.currentTimeMillis() - an.startExecuteTime) + " ms.");
    }
}
